Generally, a camera can only record a two-dimensional photo. However, if two cameras are used to photograph an object or a scene at the same time, depth information of an original photographed object can be restored, and then three-dimensional information may be restored.
Currently, when two cameras are used for photographing, accurate information used to indicate a relative position of the two cameras is required for a calculation of depth information of an original photographed object. However, in a process in which a user uses dual cameras, a relative position of the two cameras may change because of impact of dropping, pressure, temperature, or the like, and becomes inconsistent with an original relative position. Therefore, the relative position of the two cameras in the dual cameras needs to be re-calculated. Currently, a dual-camera relative position may be calculated using a group of images. It is assumed that camera intrinsic parameters are fixed, and the relative position of the two cameras in the dual cameras is deduced using an algorithm.
However, when a photographed scene is excessively far from cameras, or a most part of a scene is a plane or nearly a plane, and there is no object with rich texture in the scene, or the like, the scene is relatively difficult to recognize, and therefore accuracy of a calculated relative position obtained using a current algorithm cannot be ensured.